package com.xinhua.wuye.dao;

import java.util.ArrayList;
import java.util.List;

import com.xinhua.wuye.bean.Record;

public class RecordDAO {
	private List<Record> records = new ArrayList<>();
	
	public List<Record> getAllRecords(){
		return records;
	}
	
	public List<Record> getRecordByResidentId(String residentId){
		List<Record> subList = new ArrayList<>();
		for(Record r:records) {
			if(r.getId().equals(residentId)) {
				subList.add(r);
			}
		}
		return subList;
	}
	
	public void addRecord(Record record) {
		records.add(record);
	}
}
